Page({
    data: {
        userInfo: null,
        referShow: false
    },
    onLoad() {
        let start = () => {
            let promise = new Promise((resolve,reject) => {
                let timer = setInterval(() => {
                    let app = getApp()
                    if(app.data.userInfo) {
                        clearInterval(timer)
                        this.setData({
                            userInfo: app.data.userInfo
                        })
                        resolve()
                    }
                },1000)
            })
            return promise
        }
        start().then(() => {
            console.log(this.data.userInfo)
        })
    },
    handleReferShow() {
        this.setData({
            referShow: true
        })
    },
    handleReferHidden() {
        this.setData({
            referShow: false
        })
    },
})